<template>
    <div>

<el-tooltip class="item" effect="dark" content="双击进行修改" placement="top-start">

    <el-button v-if="status"  @click ="(status=false)" >{{value}}</el-button>
    <el-input v-else
  placeholder="请输入数量"
  type="number"
  v-model="value"
  @change="change"
    >
</el-input>

    </el-tooltip>
    </div>
</template>

<script>
import {evaluateNum} from '@/api/novel'
    export default {
        props:['scope'],
        data() {
            return {
                status:true,
                value:0
            }
        },
        created() {
            // console.log( "热门状态",this.$props.scope.row.isHot);
              this.value = this.$props.scope.row.evaluateNum 
        },
       methods: {
          async  change(){
                console.log(this.$props.scope.row.id);
              let result =    await evaluateNum({ id: this.$props.scope.row.id , evaluateNum:this.value})
              if(result.code ==20000){
                    this.$msg({
                        message:"修改成功"
                    })
              }

            }
       },
    }
</script>

<style lang="scss" scoped>

</style>